﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CNVP.Config
{
    public class UIConfig
    {
        /// <summary>
        /// 静态文件存放路径
        /// </summary>
        public static String HtmlFolder = @"/html/";
        /// <summary>
        /// 静态文件后缀
        /// </summary>
        public static String HtmlFileSuffix = @".htm";
        /// <summary>
        /// 全局静态访问开关
        /// </summary>
        public static Boolean IsHtml =  false;

        /// <summary>
        /// 安装路径
        /// </summary>
        public static string InstallDir = BaseConfig.GetConfigValue("InstallDir");
        /// <summary>
        /// 管理路径
        /// </summary>
        public static string AdminDir = BaseConfig.GetConfigValue("AdminDir");
        /// <summary>
        /// 系统管理员账号
        /// </summary>
        public static string SiteAdmin = BaseConfig.GetConfigValue("SiteAdmin");
        /// <summary>
        /// 默认模板路径
        /// </summary>
        public static string TemplateDir = BaseConfig.GetConfigValue("TemplateDir");
        /// <summary>
        /// 当前使用模板
        /// </summary>
        public static string TemplateUse = BaseConfig.GetConfigValue("TemplateUse");
        /// <summary>
        /// 站点名称
        /// </summary>
        public static string SiteName = BaseConfig.GetConfigValue("SiteName");
        /// <summary>
        /// 站点域名
        /// </summary>
        public static string SiteDomain = BaseConfig.GetConfigValue("SiteDomain");
        /// <summary>
        /// 备案号ICP
        /// </summary>
        public static string SiteICP = BaseConfig.GetConfigValue("SiteICP");
        /// <summary>
        /// 系统邮箱
        /// </summary>
        public static string MailInfo = BaseConfig.GetConfigValue("MailInfo");
        /// <summary>
        /// 邮箱账号
        /// </summary>
        public static string MailUserName = BaseConfig.GetConfigValue("MailUserName");
        /// <summary>
        /// 邮箱密码
        /// </summary>
        public static string MailUserPass = BaseConfig.GetConfigValue("MailUserPass");
        /// <summary>
        /// 邮箱服务器
        /// </summary>
        public static string MailServer = BaseConfig.GetConfigValue("MailServer");
        /// <summary>
        /// Powered
        /// </summary>
        public static string Powered = BaseConfig.GetConfigValue("Powered");
        /// <summary>
        /// Logo
        /// </summary>
        public static string Logo = BaseConfig.GetConfigValue("Logo");
        /// <summary>
        /// 注册会员过滤
        /// </summary>
        public static string UserFilter = BaseConfig.GetConfigValue("UserFilter");
        /// <summary>
        /// 版本
        /// </summary>
        public static string ProductVersion = BaseConfig.GetConfigValue("ProductVersion");
        /// <summary>
        /// 评论默认状态（1为无需审核，直接通过，其他的为需要审核）
        /// </summary>
        public static string ReviewIsApproved= BaseConfig.GetConfigValue("ReviewIsApproved");
        /// <summary>
        /// Coockie保存名称
        /// </summary>
        public static String CookiesName = BaseConfig.GetConfigValue("CookiesName");
        /// <summary>
        /// 是否开启自动缓存
        /// </summary>
        public static String AutoCache = BaseConfig.GetConfigValue("AutoCache");
        /// <summary>
        /// 缓存时间
        /// </summary>
        public static String CacheTime = BaseConfig.GetConfigValue("CacheTime");
        /// <summary>
        /// GZIP智能压缩Html
        /// </summary>
        public static String GZipHtml = BaseConfig.GetConfigValue("GZipHtml");
        /// <summary>
        /// 网站关键字
        /// </summary>
        public static String KeyWords = BaseConfig.GetConfigValue("KeyWords");
        /// <summary>
        /// 网站关键字
        /// </summary>
        public static String Describe = BaseConfig.GetConfigValue("Describe");
        
        /// 刷新缓存
        /// </summary>
        public static void RefurbishCatch()
        {
            InstallDir = BaseConfig.GetCatchParam("InstallDir");
            AdminDir = BaseConfig.GetCatchParam("AdminDir");
            SiteAdmin = BaseConfig.GetCatchParam("SiteAdmin");
            TemplateUse = BaseConfig.GetConfigValue("TemplateUse");
            TemplateDir = BaseConfig.GetCatchParam("TemplateDir");
            SiteName = BaseConfig.GetCatchParam("SiteName");
            SiteDomain = BaseConfig.GetCatchParam("SiteDomain");
            SiteICP = BaseConfig.GetCatchParam("SiteICP");
            MailInfo = BaseConfig.GetCatchParam("MailInfo");
            MailUserName = BaseConfig.GetCatchParam("MailUserName");
            MailUserPass = BaseConfig.GetCatchParam("MailUserPass");
            MailServer = BaseConfig.GetCatchParam("MailServer");
            Powered = BaseConfig.GetCatchParam("Powered");
            Logo = BaseConfig.GetCatchParam("Logo");
            UserFilter = BaseConfig.GetCatchParam("UserFilter");
            ProductVersion = BaseConfig.GetCatchParam("ProductVersion");
            ReviewIsApproved = BaseConfig.GetConfigValue("ReviewIsApproved");
            CookiesName = BaseConfig.GetConfigValue("CookiesName");
            AutoCache = BaseConfig.GetConfigValue("AutoCache");
            CacheTime = BaseConfig.GetConfigValue("CacheTime");
            GZipHtml = BaseConfig.GetConfigValue("GZipHtml");

            KeyWords = BaseConfig.GetConfigValue("KeyWords");
            Describe = BaseConfig.GetConfigValue("Describe");
        }
    }
}